<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数据校验</title>
     <!--引入2 css-->
         <link rel="stylesheet" href="../themes/default/easyui.css" type="text/css"/>
         <link rel="stylesheet" href="../themes/icon.css" type="text/css"/>
         <!--引入js文件-->
         <script type="text/javascript" src="../js/jquery.min.js"></script>
         <script type="text/javascript" src="../js/jquery.easyui.min.js"></script>
        <script type="text/javascript" src="../js/easyui-lang-zh_CN.js"></script>
</head>
<body>
<input id="vv" class="easyui-validatebox" data-options="required:true,validType:'email'" />

<hr>

姓名：<input id="nameID">
<script type="text/javascript">
$("#nameID").validatebox({
    required:true,
    validType:['length[1,6]','zhongwen']
});
//自定义 验证规则
$.extend($.fn.validatebox.defaults.rules, {
    zhongwen: {
        validator: function(value){
            if(/^[\u3220-\uFA29]*$/.test(value)){
                return true;
            }
        },
        message: '姓名必须为中文'
    }
});

</script>

<hr>

密码：<input id="passwordID"/><p/>

<script type="text/javascript">
    $("#passwordID").validatebox({
        required : true,
        validType : ['length[6,6]','english']
    });
</script>
<script type="text/javascript">
    $.extend($.fn.validatebox.defaults.rules, {
        english: {
            validator: function(value){
                if(/^[a-zA-Z]*$/.test(value)){
                    return true;
                }
            },
            message: '密码必须为英文'
        }
    });
</script>
</body>
</html>